<?php

/**
 * Zend_View_Helper_Abstract
 */
require_once 'Zend/View/Helper/Abstract.php';

/**
 * Retorna a URL base da aplicacao.
 *
 * @category Tavs
 * @package Tavs_View_Helper_BaseUrl
 *
 * @author Tales Santos <tales.augusto.santos>
 */
class Tavs_View_Helper_BaseUrl extends Zend_View_Helper_Abstract
{
	/**
	 * Retorna a URL base da aplicacao
	 *
	 * @param string $path Caminho opcional para concatenar com o baseUrl
	 *
	 * @return string
	 */
	public function baseUrl($path = null)
	{
		$front = Zend_Controller_Front::getInstance();
		$baseUrl = $front->getBaseUrl();

		if (null !== $path) {
			$baseUrl .= $path;
		}

		return $baseUrl;
	}
}